<admintpl file="header" />
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a href="{:U('cookbook/index')}">案例列表</a></li>
			<li><a href="{:U('cookbook/add')}">新增案例</a></li>
		</ul>
		<form class="well form-search" method="post" action="{:U('cookbook/index')}">
			案例名称:
			<input type="text" name="name" style="width: 100px;" value="{:I('request.name/s','')}" placeholder="请输入案例名称">
			<input type="submit" class="btn btn-primary" value="搜索" />
			<a class="btn btn-danger" href="{:U('cookbook/index')}">清空</a>
		</form>
		<form method="post" class="js-ajax-form" action="{:U('cookbook/listorders')}">
			<div class="table-actions">
				<button type="submit" class="btn btn-primary btn-small js-ajax-submit">{:L('SORT')}</button>
				<button class="btn btn-primary btn-small js-ajax-submit" type="submit" data-action="{:U('cookbook/isRecommendToggle',array('recommend'=>1))}" data-subcheck="true">推荐</button>
				<button class="btn btn-primary btn-small js-ajax-submit" type="submit" data-action="{:U('cookbook/isRecommendToggle',array('unrecommend'=>1))}" data-subcheck="true">取消推荐</button>
			</div>
			<table class="table table-hover table-bordered table-list">
				<thead>
					<tr>
						<th width="50">{:L('SORT')}</th>
						<th width="16"><label><input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x"></label></th>
						<th width="10">ID</th>
						<th width="35">名称</th>
						<th width="25">所属分类</th>
						<!--<th width="25">烹饪方法</th>-->
						<th width="45">点击量</th>
						<th width="45">是否推荐</th>
						<th width="45">创建时间</th>
						<th width="120">{:L('ACTIONS')}</th>
					</tr>
				</thead>
				<tbody>
					<foreach name="cookbooks" item="vo">
					<tr>
						<td><input name='listorders[{$vo.id}]' type='text' size='3' value='{$vo.listorder}' class='input input-order'></td>
						<td><input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]" value="{$vo.id}"></td>
						<td>{$vo.id}</td>
						<td>{$vo.name}</td>
						<td>{$vo.cfname}</td>
						<td>{$vo.read_num}</td>
						<td>
							<eq name="vo.recommended" value="1">
								是
								<else/>
								否
							</eq>
						</td>
						<td>{$vo.create_time}</td>
						<td>
							<a href="{:U('cookbook/edit',array('id'=>$vo['id'],'p'=>$p))}">{:L('EDIT')}</a> |
							<a href="{:U('cookbook/delete',array('id'=>$vo['id']))}" class="js-ajax-delete">{:L('DELETE')}</a> 
						</td>
					</tr>
					</foreach>
				</tbody>
				<tfoot>
				<tr>
					<th width="50">{:L('SORT')}</th>
					<th width="16"><label><input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x"></label></th>
					<th width="10">ID</th>
					<th width="35">名称</th>
					<th width="25">所属分类</th>
					<!--<th width="25">烹饪方法</th>-->
					<th width="45">点击量</th>
					<th width="45">是否推荐</th>
					<th width="45">创建时间</th>
					<th width="120">{:L('ACTIONS')}</th>
				</tr>
				</tfoot>
			</table>
			<div class="pagination">{$page}</div>
		</form>
	</div>
	<script src="__PUBLIC__/js/common.js"></script>
</body>
</html>